import request from '@/utils/request'

export function getRoutes(query) {
  return request({
    url: '/roles/list',
    method: 'get',
    params: query
  })
}

export function getRoles(id) {
  return request({
    url: '/roles/info',
    method: 'get',
    params: { id }
  })
}

export function addRole(data) {
  return request({
    url: '/roles/add',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: `/roles/save`,
    method: 'post',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/roles/del`,
    method: 'delete',
    params: { id }
  })
}
